package com.lframework.xingyun.basedata.controller;

import com.lframework.starter.web.core.annotations.security.HasPermission;
import com.lframework.starter.web.core.controller.DefaultBaseController;
import com.lframework.starter.web.core.components.resp.PageResult;
import com.lframework.starter.web.core.components.resp.InvokeResult;
import com.lframework.starter.web.core.components.resp.InvokeResultBuilder;
import com.lframework.xingyun.basedata.bo.member.QueryMemberAccountLogBo;
import com.lframework.xingyun.basedata.service.member.MemberAccountLogService;
import com.lframework.xingyun.basedata.vo.member.QueryMemberAccountLogVo;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;

/**
 * 会员积分账户变动记录 Controller
 *
 * @author mos
 */
@Api(tags = "会员积分账户变动记录")
@Validated
@RestController
@RequestMapping("/basedata/member-account-log")
public class MemberAccountLogController extends DefaultBaseController {

    @Autowired
    private MemberAccountLogService memberAccountLogService;

    /**
     * 会员积分账户变动记录列表
     */
    @ApiOperation("会员积分账户变动记录列表")
    @HasPermission({"base-data:member-account-log:query"})
    @GetMapping("/query")
    public InvokeResult<PageResult<QueryMemberAccountLogBo>> query(@Valid QueryMemberAccountLogVo vo) {

        PageResult<QueryMemberAccountLogBo> pageResult = memberAccountLogService.query(getPageIndex(vo), getPageSize(vo), vo);

        return InvokeResultBuilder.success(pageResult);
    }
}

